package com.example.communist_app_api.db.dao;

import com.example.communist_app_api.db.dto.SonMessageDTO;
import com.example.communist_app_api.db.pojo.UserSonmessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

@Mapper
public interface UserSonmessageDao {

    Integer insertBySystem(@Param("userSonmessage") UserSonmessage userSonmessage);

    Integer insert(@Param("content") String content, @Param("messageId") Integer messageId, @Param("userId") Integer userId);

    List<SonMessageDTO> selectAllSonMessageByMessageId(Integer id);

    List<SonMessageDTO> findAllSonMessageByUserId(Integer userId);

    List<Integer> findUserIdListByMessageId(Integer messageId);

    void deleteSonMessageByMessageId(Integer messageId);

    void deleteSonMessageById(Integer sonMessageId);

    String findContentBySonMessageId(Integer sonMessageId);
}